import Vue from 'vue'
import VueRouter from 'vue-router'
// 一级路由
import Detail from '@/views/detail-a'
import Register from '@/views/register-d'
import Layout from '@/views/layout-b'
import Login from '@/views/login-c'

// 二级路由
import Article from '@/views/erji/article-a'
import Collect from '@/views/erji/collect-c'
import Like from '@/views/erji/like-d'
import My from '@/views/erji/my-e'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/detail',
      component: Detail
    },
    {
      path: '/register',
      component: Register
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: '/article',
          component: Article
        },
        {
          path: '/collect',
          component: Collect
        },
        {
          path: '/like',
          component: Like
        },
        {
          path: '/my',
          component: My
        }
      ]
    }
  ]
})

export default router
